<%@ taglib uri="http://www.rapid-framework.org.cn/rapid" prefix="rapid"%>
<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<rapid:override name="frame-header-style">
	<link rel="stylesheet" href="resources/css/index-page.css">
</rapid:override>

<rapid:override name="frame-header-script">
	<script type="text/javascript" src="resources/js/jquery.min.js"></script>
	<script>
		$(function() {

		});
	</script>
</rapid:override>

<rapid:override name="frame-content">
	<!-- 内容主体区域 -->
	<div style="padding: 15px;">
		<blockquote class="layui-elem-quote">
			<span class="layui-breadcrumb" lay-separator="/"> 
				<a href="Login">首页</a> 
				<a><cite>评论列表</cite></a>
			</span>
		</blockquote>
		<div class="layui-tab layui-tab-card">
			<table class="layui-table" lay-even lay-skin="nob">
				<colgroup>
					<col width="100">
					<col width="300">
					<col width=200">
					<col width="150">
					<col width="50">
				</colgroup>
				<thead>
					<tr>
						<th>作者</th>
						<th>评论内容</th>
						<th>回复至</th>
						<th>提交于</th>
						<th>ID</th>
					</tr>
				</thead>
				<tbody>
					
					<c:forEach var="c" items="${pageInfo.list }">
						<tr>
							<td>
								<img src="${c.commentAuthorAvatar }" alt="" width="64px"> 
								<strong>${c.commentAuthorName }</strong> <br>
								${c.commentAuthorUrl }<br>${c.commentAuthorEmail }<br>${c.commentIp }
							</td>
							<td class="dashboard-comment-wrap">
								<c:if test="${c.commentPid!=0 }">
									<span class="at">@ </span>
								</c:if>
								<a href="https://liuyanzhao.com">${c.commentPname }</a> ${c.commentContent }
								<div class="row-actions">
									<span class=""> 
										<a href="comment/reply/${c.commentId }"> 回复</a>
									</span> 
									
									<c:if test="${c.commentRole==1 }">
										<span class=""> | 
											<a href="comment/edit/${c.commentId }/${pageInfo.pageNum }">编辑</a>
										</span> 
									</c:if>
									
									<span class=""> | 
										<a href="comment/delete/${c.commentId }?pageIndex=${pageInfo.pageNum }" onclick="return confirm('确定要删除该评论吗')">删除</a>
									</span>
								</div>
							</td>
							<td>
								<a href="/article/6" target="_blank">${c.article.articleTitle }</a>
							</td>
							<td><fmt:formatDate value="${c.commentCreateTime }" pattern="yyyy年MM月dd日 hh时mm分"/></td>
							<td>${c.commentId }</td>
						</tr>
					</c:forEach>

				</tbody>

			</table>

		</div>
		<%@ include file="../page.jsp" %>

	</div>
</rapid:override>

<%@ include file="../framework.jsp"%>